Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
10 lines (8 loc) · 441 Bytes

2.6.4 - onWorkerStop.md

File metadata and controls

10 lines (8 loc) · 441 Bytes

onWorkerStop

此事件在worker进程终止时发生。在此函数中可以回收worker进程申请的各类资源。原型:

function onWorkerStop(swoole_server $server, int $worker_id);
  • $worker_id是一个从0-$worker_num之间的数字,表示这个worker进程的ID
  • $worker_id和进程PID没有任何关系
  • 进程异常结束,如被强制kill、致命错误、core dump 时无法执行onWorkerStop回调函数